--
-- PostgreSQL database dump
--

-- Dumped from database version 9.0.4
-- Dumped by pg_dump version 9.0.4
-- Started on 2012-04-05 16:45:24 CEST

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 1823 (class 1262 OID 25829)
-- Name: stratusdb; Type: DATABASE; Schema: -; Owner: stratusdb
--

CREATE DATABASE stratusdb WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'C' LC_CTYPE = 'C';


ALTER DATABASE stratusdb OWNER TO stratusdb;

\connect stratusdb

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 6 (class 2615 OID 42209)
-- Name: SYSTEM; Type: SCHEMA; Schema: -; Owner: stratusdb
--

CREATE SCHEMA "SYSTEM";


ALTER SCHEMA "SYSTEM" OWNER TO stratusdb;

--
-- TOC entry 319 (class 2612 OID 42211)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = "SYSTEM", pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1511 (class 1259 OID 42212)
-- Dependencies: 6
-- Name: ATTRIBUTE; Type: TABLE; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

CREATE TABLE "ATTRIBUTE" (
    "OID" bigint NOT NULL,
    "NAME" character varying(255) NOT NULL,
    "TYPE" integer NOT NULL,
    "TABLE_OID" bigint NOT NULL
);


ALTER TABLE "SYSTEM"."ATTRIBUTE" OWNER TO postgres;

--
-- TOC entry 1512 (class 1259 OID 42215)
-- Dependencies: 6
-- Name: CONNECTION; Type: TABLE; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

CREATE TABLE "CONNECTION" (
    "OID" bigint NOT NULL,
    "NAME" character varying(255) NOT NULL,
    "URL" character varying(1023) NOT NULL,
    "USER" character varying(255) NOT NULL,
    "PASSWD" character varying(255) NOT NULL,
    "STORE" integer NOT NULL
);


ALTER TABLE "SYSTEM"."CONNECTION" OWNER TO postgres;

--
-- TOC entry 1515 (class 1259 OID 42265)
-- Dependencies: 6
-- Name: FUNCTION; Type: TABLE; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

CREATE TABLE "FUNCTION" (
    "OID" bigint NOT NULL,
    "NAME" character varying(255) NOT NULL,
    "SCHEMA_OID" bigint NOT NULL,
    "LANGUAGE" bigint,
    "SOURCE" text
);


ALTER TABLE "SYSTEM"."FUNCTION" OWNER TO postgres;

--
-- TOC entry 1513 (class 1259 OID 42221)
-- Dependencies: 6
-- Name: SCHEMA; Type: TABLE; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

CREATE TABLE "SCHEMA" (
    "OID" bigint NOT NULL,
    "NAME" character varying(255) NOT NULL
);


ALTER TABLE "SYSTEM"."SCHEMA" OWNER TO postgres;

--
-- TOC entry 1514 (class 1259 OID 42224)
-- Dependencies: 6
-- Name: TABLE; Type: TABLE; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

CREATE TABLE "TABLE" (
    "OID" bigint NOT NULL,
    "NAME" character varying(255) NOT NULL,
    "SOURCE_NAME" character varying(255) NOT NULL,
    "SOURCE_SCHEMA" character varying(255) NOT NULL,
    "SCHEMA_OID" bigint NOT NULL,
    "CONNECTION_OID" bigint NOT NULL
);


ALTER TABLE "SYSTEM"."TABLE" OWNER TO postgres;

--
-- TOC entry 1816 (class 0 OID 42212)
-- Dependencies: 1511
-- Data for Name: ATTRIBUTE; Type: TABLE DATA; Schema: SYSTEM; Owner: postgres
--



--
-- TOC entry 1817 (class 0 OID 42215)
-- Dependencies: 1512
-- Data for Name: CONNECTION; Type: TABLE DATA; Schema: SYSTEM; Owner: postgres
--



--
-- TOC entry 1820 (class 0 OID 42265)
-- Dependencies: 1515
-- Data for Name: FUNCTION; Type: TABLE DATA; Schema: SYSTEM; Owner: postgres
--



--
-- TOC entry 1818 (class 0 OID 42221)
-- Dependencies: 1513
-- Data for Name: SCHEMA; Type: TABLE DATA; Schema: SYSTEM; Owner: postgres
--

INSERT INTO "SCHEMA" VALUES (1, 'PUBLIC');


--
-- TOC entry 1819 (class 0 OID 42224)
-- Dependencies: 1514
-- Data for Name: TABLE; Type: TABLE DATA; Schema: SYSTEM; Owner: postgres
--



--
-- TOC entry 1794 (class 2606 OID 42231)
-- Dependencies: 1511 1511 1511
-- Name: ATTRIBUTE_TABLE_OID_NAME_key; Type: CONSTRAINT; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "ATTRIBUTE"
    ADD CONSTRAINT "ATTRIBUTE_TABLE_OID_NAME_key" UNIQUE ("TABLE_OID", "NAME");


--
-- TOC entry 1796 (class 2606 OID 42233)
-- Dependencies: 1511 1511
-- Name: ATTRIBUTE_pkey; Type: CONSTRAINT; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "ATTRIBUTE"
    ADD CONSTRAINT "ATTRIBUTE_pkey" PRIMARY KEY ("OID");


--
-- TOC entry 1798 (class 2606 OID 42235)
-- Dependencies: 1512 1512
-- Name: CONNECTION_NAME_key; Type: CONSTRAINT; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "CONNECTION"
    ADD CONSTRAINT "CONNECTION_NAME_key" UNIQUE ("NAME");


--
-- TOC entry 1800 (class 2606 OID 42237)
-- Dependencies: 1512 1512
-- Name: CONNECTION_pkey; Type: CONSTRAINT; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "CONNECTION"
    ADD CONSTRAINT "CONNECTION_pkey" PRIMARY KEY ("OID");


--
-- TOC entry 1811 (class 2606 OID 42272)
-- Dependencies: 1515 1515
-- Name: FUNCTION_pkey; Type: CONSTRAINT; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "FUNCTION"
    ADD CONSTRAINT "FUNCTION_pkey" PRIMARY KEY ("OID");


--
-- TOC entry 1802 (class 2606 OID 42239)
-- Dependencies: 1513 1513
-- Name: SCHEMA_NAME_key; Type: CONSTRAINT; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "SCHEMA"
    ADD CONSTRAINT "SCHEMA_NAME_key" UNIQUE ("NAME");


--
-- TOC entry 1804 (class 2606 OID 42241)
-- Dependencies: 1513 1513
-- Name: SCHEMA_pkey; Type: CONSTRAINT; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "SCHEMA"
    ADD CONSTRAINT "SCHEMA_pkey" PRIMARY KEY ("OID");


--
-- TOC entry 1806 (class 2606 OID 42243)
-- Dependencies: 1514 1514 1514
-- Name: TABLE_SCHEMA_OID_NAME_key; Type: CONSTRAINT; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "TABLE"
    ADD CONSTRAINT "TABLE_SCHEMA_OID_NAME_key" UNIQUE ("SCHEMA_OID", "NAME");


--
-- TOC entry 1808 (class 2606 OID 42245)
-- Dependencies: 1514 1514
-- Name: TABLE_pkey; Type: CONSTRAINT; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "TABLE"
    ADD CONSTRAINT "TABLE_pkey" PRIMARY KEY ("OID");


--
-- TOC entry 1809 (class 1259 OID 42246)
-- Dependencies: 1514
-- Name: fki_TABLE_CONNECTION_OID_fkey; Type: INDEX; Schema: SYSTEM; Owner: postgres; Tablespace: 
--

CREATE INDEX "fki_TABLE_CONNECTION_OID_fkey" ON "TABLE" USING btree ("CONNECTION_OID");


--
-- TOC entry 1812 (class 2606 OID 42247)
-- Dependencies: 1511 1514 1807
-- Name: ATTRIBUTE_TABLE_OID_fkey; Type: FK CONSTRAINT; Schema: SYSTEM; Owner: postgres
--

ALTER TABLE ONLY "ATTRIBUTE"
    ADD CONSTRAINT "ATTRIBUTE_TABLE_OID_fkey" FOREIGN KEY ("TABLE_OID") REFERENCES "TABLE"("OID") ON UPDATE CASCADE ON DELETE CASCADE;


--
-- TOC entry 1815 (class 2606 OID 42273)
-- Dependencies: 1515 1513 1803
-- Name: FUNCTION_SCHEMA_OID_fkey; Type: FK CONSTRAINT; Schema: SYSTEM; Owner: postgres
--

ALTER TABLE ONLY "FUNCTION"
    ADD CONSTRAINT "FUNCTION_SCHEMA_OID_fkey" FOREIGN KEY ("SCHEMA_OID") REFERENCES "SCHEMA"("OID") ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1813 (class 2606 OID 42252)
-- Dependencies: 1799 1514 1512
-- Name: TABLE_CONNECTION_OID_fkey; Type: FK CONSTRAINT; Schema: SYSTEM; Owner: postgres
--

ALTER TABLE ONLY "TABLE"
    ADD CONSTRAINT "TABLE_CONNECTION_OID_fkey" FOREIGN KEY ("CONNECTION_OID") REFERENCES "CONNECTION"("OID") ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1814 (class 2606 OID 42257)
-- Dependencies: 1803 1513 1514
-- Name: TABLE_SCHEMA_OID_fkey; Type: FK CONSTRAINT; Schema: SYSTEM; Owner: postgres
--

ALTER TABLE ONLY "TABLE"
    ADD CONSTRAINT "TABLE_SCHEMA_OID_fkey" FOREIGN KEY ("SCHEMA_OID") REFERENCES "SCHEMA"("OID") ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1825 (class 0 OID 0)
-- Dependencies: 7
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2012-04-05 16:45:24 CEST

--
-- PostgreSQL database dump complete
--

